<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>修改失败数据</title>
	<link rel="stylesheet" href="/layui/layui.css">
	<link rel="stylesheet" href="/css/HyqPublic.css">
	<link rel="stylesheet" href="/css/StoreCode.css">
	{$h->import('static/css/layui.css')}
	{$h->import('static/css/HyqPublic.css')}
	{$h->import('static/css/StoreCode.css')}
</head>
<style type="text/css">
	body{
		background-color: #0000;
	}
</style>
<!-- table 区域 -->
<div class="public_Pop_container">
    <h3 class="public_PopTitle">新增门店信息</h3>
    <div class="public_PopTips_container">
        <i aria-label="icon: exclamation-circle" class="anticon anticon-exclamation-circle icon" style="color:#ffc107;"><svg viewBox="64 64 896 896" focusable="false" class="" data-icon="exclamation-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 0 1 0-96 48.01 48.01 0 0 1 0 96z"></path></svg></i>
        <p>您有{count($stores_code)}条门店信息导入失败，编辑完善门店信息即可使用{if count($stores_code) > 1}异常数据已解决，请手动刷新查询{/if}</p>
    </div>
    <div class="total-delete-box flex-row align-side">
    	<span class="bold-bold">共{count($stores_code)}个门店</span>
    	<button class="layui-btn" style="float: right;" onclick="del_all()">全部删除</button>
 	</div>
 	<!-- table 区域 -->
	<div class="StoreCode_TabsStoreList_table_container" style="margin-top: 25px;">
		<table class="layui-table layui-form" lay-skin="line">
			<thead>
				<tr style="background: #fcfcfc;">
					<th>门店名称</th>
					<th>地址</th>
					<th>门店店主</th>
					<th>导入失败原因</th>
					<th>操作</th>
				</tr> 
			</thead>
			<tbody>
				{loop $stores_code as $sto} 
				<tr>
					<td>{$sto["stores_name"]}</td>
					<td>{if $sto["err_code"] == 1}{$sto["stores_address"]}{else}----{/if}</td>
					<td>{if $sto["err_code"] == 1}----{else}{$sto["user"]["name"]}{/if}</td>
					<td>{if $sto["err_code"] == 1}手机格式不正确，未匹配到员工{else}门店地址有误，未匹配到门店信息{/if}</td>
					<td class="table-btn-container">
						<span onclick="upd_stores({$sto['id']})">修改</span>
						<span onclick="del_stores({$sto['id']})">删除</span>
					</td>
				</tr>
				{/loop}
			</tbody>
		</table>
	</div>
</div>
</body>
<script src="/cdn/jquery.min.js"></script>
	<script src="/layui/layui.all.js"></script>
	<script src="/js/ajax.js"></script>
<script type="text/javascript">
	function upd_stores(id){
		layer.open({
			type: 2,
			title: '添加门店',
			shadeClose: true,
			shade: 0.2,
			area: ['845px', '770px'],
			content: 'add_stores-'+id+'.html'
		}); 
	}

	function del_all(){
		myAjaxPost(false, true, 'del_all.html', { }, function (resp) {
			layer.msg(resp.msg);
			if(resp.status == "success"){
    			setTimeout(function(){
                  	window.location.reload();
                },1000);
			}
		})
	}

	//刪除
	function del_stores(id){
		myAjaxPost(false, true, 'del_store.html', { id:id}, function (resp) {
			layer.msg(resp.msg);
			if(resp.status == "success"){
    			setTimeout(function(){
                  	window.location.reload();
                },1000);
			}
		})
	}
</script>
</html>